﻿using Iworld.Game.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Iworld.Game.Service.Backstage.Export
{
   [DataContract]
    public class BettingRecordExport
    {
        public BettingRecordExport(Betting bt)
        {
            this.Owner = new AuthorExport(bt.Owner);
            this.GameChapterNumber = bt.GameRound.GameChapter.ChapterNumber;
            this.GameRoundNumber = bt.GameRound.RoundNum;
            this.Spade = bt.Spade;
            this.Heart = bt.Heart;
            this.Club = bt.Club;
            this.Diamond = bt.Diamond;
            this.King = bt.King;
            this.Status = bt.Status;
            this.Bonus = bt.Bonus;
            this.CreatedTime = bt.CreatedTime;
            Profit = Bonus - (Spade + Heart + Club + Diamond + King);
        }

       /// <summary>
       /// 投注时间
       /// </summary>
       [DataMember] 
       public DateTime CreatedTime { get; set; }

        /// <summary>
        /// 投注人
        /// </summary>
       [DataMember] 
       public AuthorExport Owner { get; set; }

       [DataMember] 
        public int GameChapterNumber { set; get; }

       [DataMember] 
        public int GameRoundNumber { set; get; }
        /// <summary>
        /// 黑桃的投注量
       /// </summary>
       [DataMember] 
        public double Spade { set; get; }
        /// <summary>
        /// 红桃的投注量
       /// </summary>
       [DataMember] 
        public double Heart { set; get; }
        /// <summary>
        /// 梅花的投注量
       /// </summary>
       [DataMember] 
        public double Club { set; get; }
        /// <summary>
        /// 方块的投注量
       /// </summary>
       [DataMember] 
        public double Diamond { set; get; }
        /// <summary>
        /// 王的投注量
       /// </summary>
       [DataMember] 
        public double King { set; get; }

        /// <summary>
        /// 当前状态
       /// </summary>
       [DataMember] 
        public BettingStatus Status { get; set; }

        /// <summary>
        /// 中奖分数
       /// </summary>
       [DataMember] 
        public double Bonus { get; set; }
       /// <summary>
       /// 盈亏
       /// </summary>
        [DataMember] 
       public double Profit { set; get; }
    }
}
